#!/usr/bin/perl
use strict;
use modules::encode;

sub cskey {
    my ($dbh,$remote,$input,$csnum) = @_;
    if ($$input[4] eq "") {
	print $remote "$csnum O $$input[0] :Syntax :GETKEY <#channel>\n";
    }
    else {
	my $sth=$dbh->prepare("SELECT auth FROM ninfo WHERE num = '$$input[0]' AND code = '".encode::encode($$input[0])."';");
	$sth->execute;
    }
}
1;
